﻿@model InstallModel
@using RCSoft.Core.Infrastructure;
@using RCSoft.Web.Models.Install;
@using RCSoft.Web.Infrastructure.Installation;
@{
    var InstallLocService = EngineContext.Current.Resolve<IInstallationLocalizationService>();
    ViewBag.Title = InstallLocService.GetResource("Title");
 }
 @using (Html.BeginForm("Index", "Install", FormMethod.Post, new { id = "installation-form" }))
 { 
     <script type="text/javascript">
         $(document).ready(function () {
             $('#installation-form').submit(function () {
                 if ($('#installation-form').valid()) {
                     window.setTimeout(function () {
                         $(".throbber").show();
                     }, 1000);
                     $('input[type=submit]', this).attr('disabled', 'disabled');
                 }
             });
         });
    </script>
    <div style="width:900px; text-align:center"><h2>@InstallLocService.GetResource("Title")</h2></div>
     <div style="width:800px; color:Red;">@Html.ValidationSummary(false)</div>
    <table style="width:900px;">
        <tr>
            <td style="width:20%; text-align:right;"><label for="AdminUser">@InstallLocService.GetResource("AdminUser"):</label></td>
            <td style="text-align:left;">@Html.TextBoxFor(x => x.AdminEmail, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="Password">@InstallLocService.GetResource("AdminPassword"):</label></td>
            <td style="text-align:left;">@Html.PasswordFor(x => x.AdminPassword, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="ConfirmPassword">@InstallLocService.GetResource("ConfirmPassword"):</label></td>
            <td style="text-align:left;">@Html.PasswordFor(x => x.ConfirmPassword, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="CreateDemoData">@InstallLocService.GetResource("CreateDemoData"):</label></td>
            <td style="text-align:left;">@Html.CheckBoxFor(x => x.InstallSampleData, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="SQLServerName">@InstallLocService.GetResource("SqlServerName"):</label></td>
            <td style="text-align:left;">@Html.TextBoxFor(x => x.SqlServerName, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="DataBaseName">@InstallLocService.GetResource("DataBaseName"):</label></td>
            <td style="text-align:left;">@Html.TextBoxFor(x => x.SqlDatabaseName, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="SQLServerUserName">@InstallLocService.GetResource("SqlServerUserName"):</label></td>
            <td style="text-align:left;">@Html.TextBoxFor(x => x.SqlServerUsername, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td style="text-align:right;"><label for="SQLServerPassword">@InstallLocService.GetResource("SQLServerPassword"):</label></td>
            <td style="text-align:left;">@Html.PasswordFor(x => x.SqlServerPassword, new { @class = "textbox" })</td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center"><input type="submit" value="@InstallLocService.GetResource("Install")" style="width:100px;" /></td>
        </tr>
    </table>
     <div class="throbber">
            <div class="curtain">
            </div>
            <div class="curtain-content">
                <div>
                    <h1 class="throbber-header">
                        @InstallLocService.GetResource("Installing")</h1>
                    <p>
                        <img src="@Url.Content("~/content/images/install-synchronizing.gif")" alt="" />
                    </p>
                </div>
            </div>
        </div>
 }
